<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ViewOrdersTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:panelGrid columns="2">
                <h:outputText value="#{bundle.ViewOrdersLabel_date}"/>
                <h:outputText value="#{ordersController.selected.date}" title="#{bundle.ViewOrdersTitle_date}">
                    <f:convertDateTime pattern="MM/dd/yyyy HH:mm" />
                </h:outputText>
                <h:outputText value="#{bundle.ViewOrdersLabel_message}"/>
                <h:outputText value="#{ordersController.selected.message}" title="#{bundle.ViewOrdersTitle_message}"/>
            </h:panelGrid>
            <br />
            <h:form styleClass="jsfcrud_list_form">
                <h:dataTable value="#{ordersController.orderItems()}" var="item" border="0" 
                             cellpadding="2" cellspacing="0" 
                             rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" 
                             style="border:solid 1px">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListProductsTitle_name}"/>
                        </f:facet>
                        <h:outputText value="#{item.name}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListProductsTitle_price}"/>
                        </f:facet>
                        <h:outputText value="#{item.price}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListProductsTitle_productTypeId}"/>
                        </f:facet>
                        <h:outputText value="#{item.productTypeId.name}"/>
                    </h:column>
                </h:dataTable>
                <br />
                <br />
                <h:commandLink action="#{ordersController.prepareList}" value="#{bundle.ViewOrdersShowAllLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
